home *** CD-ROM | disk | FTP | other *** search
- % -----------------------------------------------------------------------------
- % Get keyboard scancodes *TERMINATE PRESCRIPTION*
- % -----------------------------------------------------------------------------
- %
- % Version : 1.00
- % Filename : KEYSCAN.TSL
- % Company : None
- % Programmer : Dave Wapstra 2:280/811.17, davew@xs4all.nl
- % Module created : 06 Nov 1995
- % Latest revision : 06 Nov 1995 DW
- % Language/version : Terminate Prescription 1.00
- % Remarks : Shows keyboard scan codes for StuffKey function
- % Known bugs : F11, F12 and maybe some more do not work
- %
- % -----------------------------------------------------------------------------
-
- Function GetKeyScan()
- Set Result = Interrupt(22,0,0,0,0,0,0,0,0)
- Set GetKeyScan = (GrabWord(Result,1) * 256) + GrabWord(Result,2)
- EndFunc GetKeyScan
-
- Set Key = 0
-
- Window 1,1,30,15,6,0,23,23,27," ScanKey "
- WriteAStr 2,0,23," Esc to Abort "
-
- Repeat
- If KeyPressed
- Set KeyCode = GetKeyScan(Dummy)
- SetAttr 30
- Println KeyCode
- EndIf
- If AltPressed=1
- WriteAStr 2,14,23+128," Alt "
- Else
- WriteAStr 2,14,23,"─────"
- Endif
- If CtrlPressed=1
- WriteAStr 9,14,23+128," Ctrl "
- Else
- WriteAStr 9,14,23,"──────"
- Endif
- If ShiftPressed=1
- WriteAStr 16,14,23+128," Shift "
- Else
- WriteAStr 16,14,23,"───────"
- Endif
- Until KeyCode = 283
-
- RemoveWindow
-
- Terminate
-
-